package com.btt.pattern.factory.simple;

import com.btt.pattern.factory.Milk;
import com.btt.pattern.factory.Telunsu;
import com.btt.pattern.factory.Yili;

/**
 * 设计模式 -- 简单工厂模式
 */
public class SimpleFactory {

    public Milk getMilk(String name){
        if("特仑苏".equals(name))
            return new Telunsu();
        else if("伊利".equals(name))
            return new Yili();
        else
            return null;
    }

}
